import VueRouter from 'vue-router'
//安装路由插件 npm i vue-router@3.5.4
const routes = [
    {
        path:'/VsHome',
        name:'vsHome',
        component:()=>import('../view/VsHome'),
    },
    {
        path:'/VsScenic',
        name:'vsScenic',
        component:()=>import('../view/VsScenic')
    },
    {
        path:'/VsFood',
        name:'vsFood',
        component:()=>import('../view/VsFood')
    },
    {
        path:'/VsHotel',
        name:'vsHotel',
        component:()=>import('../view/VsHotel')
    },
    {
        path:'/VsPerson',
        name:'vsPerson',
        component:()=>import('../view/VsPerson')
    },
    //改这里选择先运行那个页面
    {
        path:'/',
        name:'login',
        component:()=>import('../components/Login')
    },
    {
        path:'/Register',
        name:'register',
        component:()=>import('../components/Register')
    },
    
    {
        path:'/Index',
        name:'index',
        component:()=>import('../components/Index'),
        children:[
            // {
    //     path:'/Home',
    //     name:'home',
    //     component:()=>import('../components/Home')

    // },
            // {
            //     path:'/Home',
            //     name:'home',
            //     meta:{
            //         title:'首页'
            //     },
            //     component:()=>import('../components/Home.vue')
            // },
            {
                path:'/Person',
                name:'person',
                meta:{
                    title:'个人中心'
                },
                component:()=>import('../components/person/Person.vue')
            },
            {
                path:'/ChangePass',
                name:'changePass',
                meta:{
                    title:'修改密码'
                },
                component:()=>import('../components/person/ChangePass.vue')
            },
            // {
            //     path:'/DateUtils',
            //     name:'dateUtils',
            //     meta:{
            //         title:'个人中心'
            //     },
            //     component:()=>import('../components/person/Person.vue')
            // },
            {
                path:'/Admin',
                name:'admin',
                meta:{
                    title:'管理员管理'
                },
                component:()=>import('../components/admin/AdminManage.vue')
            },
            {
                path:'/User',
                name:'user',
                meta:{
                    title:'用户管理'
                },
                component:()=>import('../components/user/UserManage.vue')
            },
            {
                path:'/Hotel',
                name:'hotel',
                meta:{
                    title:'酒店管理'
                },
                component:()=>import('../components/hotel/HotelManage.vue')
            },
            {
                path:'/Food',
                name:'food',
                meta:{
                    title:'美食管理'
                },
                component:()=>import('../components/food/FoodManage.vue')
            },
            {
                path:'/Scenic',
                name:'scenic',
                meta:{
                    title:'景点管理'
                },
                component:()=>import('../components/scenic/ScenicManage.vue')
            },
            {
                path:'/ScenicType',
                name:'scenicType',
                meta:{
                    title:'景点分类管理'
                },
                component:()=>import('../components/scenic/ScenicTypeManage.vue')
            },
            {
                path:'/LunboManage',
                name:'lunboManage',
                meta:{
                    title:'轮播图片管理'
                },
                component:()=>import('../components/lunbo/LunboManage.vue')
            },
            // {
            //     path:'/ScenicLine',
            //     name:'scenicLine',
            //     meta:{
            //         title:'旅游路线管理'
            //     },
            //     component:()=>import('../components/scenic/ScenicLineManage.vue')
            // },
        ]
    }
]

const router = new VueRouter({
    mode:'history',
    routes
})
const VueRouterPush = VueRouter.prototype.push
VueRouter.prototype.push = function push (to){
    return VueRouterPush.call(this, to).catch(err => err)
}
export default router;